-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add select only option to listbox toggle mode #8168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add select only option to listbox toggle mode #8168
Conversation
we really need this in our Multi Select component :) |
@devongovett @LFDanLu Would love to get your review on this one 🙏 |
To clear the selection, wouldn't you press Esc? I'm not sure I've come across this particular keyboard behaviour before, but maybe I never knew about it, do you have some examples in the real world or specs that outline this behaviour for aria? |
Thanks for the review! Yeah, you could clear and then set but this solution romoves the need for that extra step. One example I'm aware of is the layers panel in Illustrator I think. If you hold meta and click on the eye icon it should behave in a similar way. |
The selection behaviour for the layers panel in Illustrator appears to be doing the same thing as selectionBehavior="replace" Steps:
Steps:
I repeated the same steps in an Illustrator document with multiple layers. Update: |
In some cases when using the default selection behavior for the ListBox which is toggle in multi selection mode, you want the ability to clear out all existing selections and only "focus" on one option.
As I see it, this is complimentary to the existing feature where it is possible to switch to "toggle" mode when holding ctrl/cmd in selection behavior replace. This is essentially the inverse of that behavior.